package com.sanbi.shield.server.controller;

import com.sanbi.shield.common.bean.KeyNamePair;
import com.sanbi.shield.common.repsonse.CommonResponse;
import com.sanbi.shield.server.biz.service.UserInfoService;
import com.sanbi.shield.server.common.bean.request.UserSelectQueryRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户信息Controller
 *
 * @author XiaoQingqing
 * @since 2024/08/08
 */
@Validated
@RestController
@RequestMapping("/user/info")
@Api(value="用户信息Controller", tags={"用户信息"})
public class UserInfoController {
    /**
     * 用户信息Service
     */
    @Resource
    private UserInfoService userInfoService;

    @PostMapping("/select")
    @ApiOperation(value = "下拉选择用户查询")
    public CommonResponse<List<KeyNamePair<Long, String>>> querySelectUser(@RequestBody @Validated UserSelectQueryRequest request) {
        return CommonResponse.ok(userInfoService.querySelectUser(request));
    }

}
